package com.javaxiaobang.thread;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 功    能：
 * 作    者：tianqiang
 * 时    间：2019/11/16
 */
public class HystrixThreadLocalManager {

    private final static AtomicLong counter = new AtomicLong(1);

    private final static ThreadLocal threadLocal = new InheritableThreadLocal();

    public static void setName() {
        Long number = counter.getAndIncrement();
        threadLocal.set(number + "---次请求-----------------");
    }

    public static Object getName() {
        return threadLocal.get();
    }

}
